﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HPsite.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="nelech.Views.Shared.Code" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  מסלולי טיול, מעיינות, אטרקציות וצימרים למשפחות - נלך
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
  
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Right" runat="server">
    <% var model = (Object[])this.Model;
       var lastTrack = (nelech.Models.DBModel.Track)model[0];
       var lastSpring = (nelech.Models.DBModel.Maayan)model[1];
       var lastPlace = (nelech.Models.DBModel.Place)model[2];
      
    %>
    <p class="advert">
    </p>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var model = (Object[])this.Model;

       var placeList = (List<nelech.Models.DBModel.Place>)model[3];
       var springList = (List<nelech.Models.DBModel.Maayan>)model[4];
       var trackList = (List<nelech.Models.DBModel.Track>)model[5];
    %>
    <div id="mainIndex">
        <h2>
            ברוכים הבאים לאתר נלך!</h2>
            <%var text = (nelech.Models.DBModel.Text)ViewData["text"]; %>
            <%= text.text1 %>
        <div class="userForm">
            <% using (Html.BeginForm("Search", "Track"))
               { %>
            <fieldset>
                <legend>חיפוש טיול:</legend>
                <p>
                    <label for="area">
                        אזור:</label>
                    <%= Html.DropDownList("regeon", Utils.CreateRegeonListItems(21)) %>
                    <label for="season">
                        עונה:</label>
                    <%= Html.DropDownList("season", Utils.CreateSeasonListItems(1)) %>
                </p>
                <p>
                    <label for="difficulty">
                        רמת קושי:</label>
                    <%= Html.DropDownList("difficulty", Utils.CreateDifficultyItem(1),null,null) %>
                    <label for="water">
                        מים:</label><%= Html.DropDownList("water", Utils.CreateWaterListItems(0) )%>
                </p>
                <p>
                    <label for="duration">
                        משך הטיול:</label>
                    <%= Html.DropDownList("duration", Utils.CreateDurationItem(1)) %>
                </p>
                <p>
                    <label for="traffic">
                        דרכי הגעה:</label>
                    <%= Html.DropDownList("traffic", Utils.CreateTrafficItem(5)) %>
                </p>
                <p>
                    <label for="">
                        חיפוש חופשי:</label>
                    <%= Html.TextBox("searchString") %></p>
                <span class="floatleft">
                    <input type="submit" value="חפש" /></span>
            </fieldset>
            <%} %>
        </div>
    </div>
    <div id="leftIndex">
    <h2></h2>
        <img src="../../Content/Images/israelmap.jpg" alt="מפת ארץ ישראל מחולקת לאזורים" title="מפת ארץ ישראל מחולקת לאזורים"
            usemap="#israel_map" />
        <map name="israel_map" id="israel_map"> 
         <area shape="poly" coords="138,25,142,5,152,8,164,4,162,25,167,39,171,47,168,57,161,65,153,73,144,75,143,81,136,81,137,25,136,23" href="/Home/IsraelMap/1" alt="החרמון, הגולן ואצבע הגליל" title="החרמון, הגולן ואצבע הגליל" />
  <area shape="poly" coords="95,61,98,51,96,45,98,36,102,27,106,29,118,28,122,33,127,33,135,28,134,56,136,59" href="/Home/IsraelMap/2" alt="הגליל העליון" title="הגליל העליון" />
  <area shape="poly" coords="90,62,94,61,104,61,102,109,75,109,82,77,86,63" href="/Home/IsraelMap/4" alt="הכרמל" title="הכרמל"/>

  <area shape="poly" coords="112,63,103,61,102,109,139,110,141,99,140,91,142,81,136,73,136,60,107,61,110,62" href="/Home/IsraelMap/3" alt="הגליל התחתון והעמקים" title="הגליל התחתון והעמקים"/>
  <area shape="poly" coords="104,111,141,110,142,127,141,139,138,147,136,157,104,157" href="/Home/IsraelMap/5" alt="בקעת הירדן ומזרח השומרון" title="בקעת הירדן ומזרח השומרון"/>
  <area shape="poly" coords="73,109,104,110,103,157,62,157" href="/Home/IsraelMap/7" alt="השרון ומערב השומרון " title="השרון ומערב השומרון "/>
<area shape="poly" coords="112,156,136,157,142,165,138,168,139,179,138,185,144,189,142,207,112,208" href="/Home/IsraelMap/8" alt="צפון מדבר יהודה וים המלח" title="צפון מדבר יהודה וים המלח"/>
<area shape="rect" coords="83,157,112,209" href="/Home/IsraelMap/9" alt="מבואות ירושלים" title="מבואות ירושלים"/>
<area shape="poly" coords="61,157,82,157,83,208,41,207" href="/Home/IsraelMap/10" alt="גוש דן וחוף פלשת" title="גוש דן וחוף פלשת"/>
<area shape="poly" coords="112,209,139,207,136,253,114,254" href="/Home/IsraelMap/11" alt="דרום מדבר יהודה וים המלח" title="דרום מדבר יהודה וים המלח"/>
<area shape="rect" coords="65,207,114,256" href="/Home/IsraelMap/12" alt="דרום השפלה  ושולי הר חברון" title="דרום השפלה  ושולי הר חברון"/>
<area shape="poly" coords="38,207,64,207,64,255,18,255,11,241" href="/Home/IsraelMap/13" alt="מישור הנגב ונגב המערבי" title="מישור הנגב ונגב המערבי"/>
<area shape="poly" coords="96,255,126,253,132,262,126,282,128,287,120,293,119,301,116,309,96,311" href="/Home/IsraelMap/14" alt="צפון הערבה ומזרח הנגב" title="צפון הערבה ומזרח הנגב"/>
<area shape="rect" coords="57,255,96,313" href="/Home/IsraelMap/15" alt="הנגב התיכון" title="הנגב התיכון"/>
<area shape="poly" coords="16,255,56,255,56,309,36,311" href="/Home/IsraelMap/16" alt="חולות ורמת הנגב" title="חולות ורמת הנגב"/>
<area shape="poly" coords="116,310,72,311,70,367,99,369,105,357,102,346,106,328" href="/Home/IsraelMap/17" alt="הערבה התיכונה ומזרח הר הנגב" title="הערבה התיכונה ומזרח הר הנגב"/>
<area shape="poly" coords="36,311,71,312,70,367,52,368,44,348,43,338,39,334" href="/Home/IsraelMap/18" alt="מערב הר הנגב" title="מערב הר הנגב"/>
<area shape="poly" coords="50,369,98,369,103,379,102,388,96,396,92,403,92,413,67,413" href="/Home/IsraelMap/19" alt="מישור פארן והנחלים הגדולים" title="מישור פארן והנחלים הגדולים"/>
<area shape="poly" coords="66,413,94,412,88,429,87,439,84,448,86,452,78,455,77,459,72,453,74,437" href="/Home/IsraelMap/20" alt="הרי אילת" title="הרי אילת"/>
</map> 
       <% Html.RenderPartial("ContactUs", new nelech.Models.ContactModel.ContactUpdets()); %>
        <div class="advertIndexLeft">
        <%Html.RenderAction("AdvertShow", "Advert", new { id = 3 });%>  
         
       </div>  

       


     </div>
    <div class="recommended">
        <%
            int i = 2;

            if (trackList.Count() > 0)
            {
                foreach (var track in trackList)
                {
                    var name = i < 2 ? "recommended1" : "recommended1";
                    i++;
        %>
        <fieldset class="<%=name%>">
            <legend>
                <%= Html.ActionLink(track.title, "TrackInfo", "Track", new { id = track.number }, null)%>
            </legend>
            <p class="floatright">
                <% if (track.Image.Count > 0)
                   {
                       var images = track.Image.OrderBy(p => p.path);
                       var firstImage = images.First();
                       var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
                %>
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>"
                    width="100px" />
                <% } %>
            </p>
            <%= track.summary%>
            <p>
                <span class="bold">אזור:</span><%= track.Regeon1.text%>
                <%if (Model != null && track.Subject.Count() > 0)
                  {%><span class="bold">נושא:</span>
                <% foreach (var subject in track.Subject)
                   {
                       Response.Write(subject.text + ", ");
                   }
             
                %>
                <%} %>
                <%if (Model != null && track.Season.Count() > 0)
                  {%>
                <span class="bold">עונה:</span>
                <%    foreach (var season in track.Season)
                      {
                          Response.Write(season.text + ", ");
                      }

                  } %>
                <%if (Model != null && track.Traffic.Count() > 1)
                  {%>
                <span class="bold">תחבורה:</span>
                <%   foreach (var traffic in track.Traffic)
                     {
                         Response.Write(traffic.text + ", ");
                     }
              
                %>
                <%} %>
                <span class="bold">בתשלום:</span>
                <%= Html.Encode(track.Cost1.text) %>
                <span class="bold">משך:</span>
                <%= Html.Encode(track.Duration1.text) %>
                <span class="bold">זמן:</span>
                <%= Html.Encode(track.Time1.text) %>
                <span class="bold">קושי:</span>
                <%= Html.Encode(track.Difficulty1.text) %>
                <% if (track.km != null)
                   {%>
                <span class="bold">אורך בק"מ:</span>
                <%= Html.Encode(track.km + " ק\"מ")%><%} %></p>
            <%= Html.ActionLink("להרחבה", "TrackInfo", "Track", new { id = track.number }, null)%>
            <%%>
        </fieldset>
        <% }%>
        <div class="advertmiddle" jquery1289502056423="8" style="display: block">
            <div class="advertmiddleSon">
                <%Html.RenderAction("AdvertShow", "Advert", new { id = 9 });%>
            </div>
            <div class="x" onclick="$(this).parent().slideUp();">
                x</div>
        </div>
        <%
          
            } %>
        <% if (springList.Count() > 0)
           {
               foreach (var spring in springList)
               {
                   var name = i < 2 ? "recTop" : "recommended1";
                   i++;
        %>
        <fieldset class="<%= name %>">
            <legend>
                <%= Html.ActionLink(spring.name, "SpringInfo", "Place", new { id = spring.id }, null)%>
            </legend>
            <p class="floatright">
                <% if (spring.Image.Count > 0)
                   {
                       var images = spring.Image.OrderBy(p => p.path);
                       var firstImage = images.First();
                       var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
                %>
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>" width="150px" />
                <% } %></p>
            <%= Html.Encode(spring.summary)%>
            <p>
                <span class="bold">מפת סימון שבילים: </span>
                <%= Html.Encode(spring.Regeon1.id + " - " + spring.Regeon1.text)%>
                <span class="bold">עונת הנביעה:</span>
                <%= Html.Encode(spring.Nevia1.text)%>
            </p>
            <p>
                <%= Html.ActionLink("להרחבה", "SpringInfo", "Place",  new { id = spring.id }, null)%></p>
        </fieldset>
        <% 
            }
           }
           if (placeList.Count() > 0)
           {
               foreach (var place in placeList)
               {
                   var name = i < 2 ? "recTop" : "recommended1";
                   i++;
        %>
        <fieldset class="<%= name %>">
            <legend>
                <%= Html.ActionLink(place.name, "PlaceInfo", "Place", new {id= place.id }, null)%></legend>
            <p class="floatright">
                <% if (place.Image.Count > 0)
                   {
                       var images = place.Image.OrderBy(p => p.path);
                       var firstImage = images.First();
                       var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
                %>
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>"
                    width="100px" />
                <% } %>
            </p>
            <p>
                <%= place.summary%>
            </p>
            <p>
                <span class="bold">אזור:</span><%= place.Regeon1.text%>
                <%if (Model != null && place.Type != null)
                  {%>
                <span class="bold">סוג המקום:</span>
                <%    foreach (var type in place.Type)
                      {
                          Response.Write(type.text + ", ");
                      }
                  }
                %>
                <span class="bold">בתשלום:</span>
                <%= Html.Encode(place.Cost1.text)%>
                <span class="bold">במפת סימון שבילים:</span>
                <%= Html.Encode(place.Regeon1.id + " - " + place.Regeon1.text)%></p>
            <%= Html.ActionLink("להרחבה", "PlaceInfo", "Place", new {id= place.id }, null)%>
        </fieldset>
        <% 
               }%>
        <%} %>
    </div>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="AdvertShow1" runat="server">
<%var count = (int)ViewData["advertCount"];
  var array = (int[])ViewData["advertsArray"];
  if (count > 0)
  {

      Html.RenderAction("AdvertShow", "Advert", new { id = 2, random1 = array[0] });
  } if (count > 1)
  {
      Html.RenderAction("AdvertShow", "Advert", new { id = 2, random1 = array[1] });
  }
  if (count > 2)
  {
      Html.RenderAction("AdvertShow", "Advert", new { id = 2, random1 = array[2] });
  }%>
  
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="AdvertShow2" runat="server">
<%var count = (int)ViewData["advertCount"];
  var array = (int[])ViewData["advertsArray"];
  if (count > 3)
  {
      Html.RenderAction("AdvertShow", "Advert", new { id = 2, random1 = array[3] });
  }
  if (count > 4)
  {
      Html.RenderAction("AdvertShow", "Advert", new { id = 2, random1 = array[4] });
  }%>
            
</asp:Content>